package hu.conclusion.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.user.client.History;


public class Hu_conclusion implements EntryPoint {
	// private final GreetingServiceAsync greetingService = GWT
	// .create(GreetingService.class);

	public void onModuleLoad() {
	}

	public void onValueChange(ValueChangeEvent<String> event) {
		changePage(History.getToken());
	}

	public void changePage(String token) {
		if (History.getToken().equals("home")) {
			// homePageGUI homePage = new homePageGUI(mainPanel);

		} else if (History.getToken().equals("login")) {
			// loginGUI login = new loginGUI(this);
		} else if (History.getToken().equals("accountaanmaken")) {
			// createAccountGUI createAccount = new createAccountGUI(mainPanel,
			// this);
		} else if (History.getToken().equals("adminIndex")) {
			// adminIndex aIndex = new adminIndex(mainPanel, this);
		} else if (History.getToken().equals("adminUserStatus")) {
			// adminUserStatus aIndex = new adminUserStatus(mainPanel, this);
		} else if (History.getToken().equals("adminProductStatus")) {
			// adminProductStatus aIndex = new adminProductStatus(mainPanel,
			// this);
		} else if (History.getToken().equals("userCreateProduct")) {
			// UserCreateProductGUI aIndex = new UserCreateProductGUI(mainPanel,
			// this);
		} else if (History.getToken().equals("userCreateProductList")) {
			// CreateProductListGUI aIndex = new CreateProductListGUI(mainPanel,
			// this);
		} else if (History.getToken().equals("personalPage")) {
			// personalPageGUI personalPage = new personalPageGUI(this);
		} else if (History.getToken().equals("logout")) {
			// setUser(new User());
			// reloadHeader();
			History.newItem("home");
		} else {
			// mainPanel.clear();
			// mainPanel.add(new Label("Unknown Page"));
		}
	}
}
